Skip to content

feat: import manual maintainers (CM-1299) - #4292

Merged
ulemons merged 6 commits into
mainfrom
feat/import-manual-maintianers
Jul 3, 2026
Merged

feat: import manual maintainers (CM-1299)#4292
ulemons merged 6 commits into
mainfrom
feat/import-manual-maintianers

Conversation

@ulemons

@ulemons ulemons commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds ingestion_source tracking to package_maintainers to distinguish manually-imported maintainer records from automatically-enriched ones. This makes it possible to audit, update, or roll back manual entries independently.

Changes

  • Migration (V1782978597__package_maintainers_ingestion_source.sql): adds ingestion_source text column to package_maintainers — nullable so existing rows default to null (meaning auto-enriched, pre-column)
  • Tinybird (packageMaintainers.datasource): adds ingestionSource field to replicate the new column downstream
  • DAL (osspckgs/maintainers.ts): adds ingestionSource optional param to insertPackageMaintainerLink; uses selectOneOrNone instead of selectOne().catch(() => null) to avoid swallowing real DB errors
  • DAL (osspckgs/types.ts): adds optional ingestionSource field to IDbPackageMaintainerUpsert
  • Script (importMaintainersFromCsv.ts): passes ingestion_source = 'manual_csv' on insert; existing links (DO NOTHING on conflict) are never overwritten — preserves the source of records that were already in the DB

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

JIRA ticket

CM-1299


Note

Medium Risk
replacePackageMaintainers behavior changed for all Maven/NuGet enrichment: manual links are preserved but auto-sync no longer updates roles on conflicting package–maintainer pairs (DO NOTHING). Nullable schema migration is low risk; operational imports write production osspckgs data.

Overview
Adds ingestion_source on package_maintainers so manual CSV imports (manual_csv) are auditable and separable from auto-enrichment, with Tinybird replicating the new field.

The DAL gains insertPackageMaintainerLink (idempotent insert with optional source), upsertMaintainer now persists github_login, and contributor as a link role. replacePackageMaintainers only deletes/replaces non-manual_csv links and uses ON CONFLICT DO NOTHING on re-insert so manual rows are not overwritten when Maven/NuGet enrichment runs.

import:maven-maintainers runs a script that upserts maintainers from reviewed CSV, writes links tagged manual_csv, and emits a rollback SQL file. fetchMavenMaintainers.ts (offline tooling) enriches a package list via Libraries.io, POM SCM, and GitHub (CODEOWNERS / MAINTAINERS / contributors) into import-ready CSV.

Reviewed by Cursor Bugbot for commit f3852ca. Bugbot is set up for automated code reviews on this repo. Configure here.

@ulemons ulemons self-assigned this Jul 2, 2026
Copilot AI review requested due to automatic review settings July 2, 2026 08:05
@ulemons ulemons added the Feature Created by Linear-GitHub Sync label Jul 2, 2026
Comment thread services/apps/packages_worker/src/maven/scripts/importMaintainersFromCsv.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds ingestion_source tracking to the package_maintainers table so manually-imported maintainer links can be distinguished from auto-enriched ones and rolled back or audited independently. It also plumbs github_login persistence through the maintainers upsert and introduces two operational scripts to fetch candidate Maven maintainers into a review CSV and then import that CSV into the osspckgs DB.

Changes:

  • Schema/Tinybird: add nullable ingestion_source column to package_maintainers and replicate it downstream.
  • DAL: add insertPackageMaintainerLink (insert-only, ON CONFLICT DO NOTHING) with optional ingestionSource, and persist/track github_login in upsertMaintainer; extend the corresponding types.
  • Scripts: fetchMavenMaintainers.ts builds a review CSV from Libraries.io / POM SCM / GitHub; importMaintainersFromCsv.ts loads it with per-package transactions, --dry-run, and a generated rollback SQL.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backend/src/osspckgs/migrations/V1782978597__package_maintainers_ingestion_source.sql Adds nullable ingestion_source column (additive, IF NOT EXISTS).
services/libs/tinybird/datasources/packageMaintainers.datasource Adds ingestionSource field to the replicated schema; DESCRIPTION not updated.
services/libs/data-access-layer/src/osspckgs/types.ts Adds optional githubLogin and ingestionSource fields to upsert types.
services/libs/data-access-layer/src/osspckgs/maintainers.ts Persists/tracks github_login; adds insertPackageMaintainerLink with ingestionSource.
services/apps/packages_worker/src/maven/scripts/fetchMavenMaintainers.ts New script producing a maintainer-candidate CSV for manual review.
services/apps/packages_worker/src/maven/scripts/importMaintainersFromCsv.ts New import script writing links with ingestion_source = 'manual_csv' plus rollback SQL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/apps/packages_worker/src/maven/scripts/importMaintainersFromCsv.ts Outdated
Comment thread services/apps/packages_worker/src/maven/scripts/importMaintainersFromCsv.ts Outdated
Comment thread services/apps/packages_worker/src/maven/scripts/fetchMavenMaintainers.ts Outdated
Comment thread services/libs/tinybird/datasources/packageMaintainers.datasource
Comment thread services/apps/packages_worker/src/maven/scripts/fetchMavenMaintainers.ts Outdated
Copilot AI review requested due to automatic review settings July 2, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Comment thread services/apps/packages_worker/src/maven/scripts/fetchMavenMaintainers.ts Outdated
Comment on lines +31 to +35
function parseCsv(content: string): Record<string, string>[] {
const rows: string[][] = []
let cur = ''
let inQuote = false
let row: string[] = []
Comment thread services/apps/packages_worker/src/maven/scripts/fetchMavenMaintainers.ts Outdated
Copilot AI review requested due to automatic review settings July 2, 2026 11:28
Comment thread services/libs/data-access-layer/src/osspckgs/maintainers.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread services/libs/data-access-layer/src/osspckgs/maintainers.ts
@ulemons
ulemons force-pushed the feat/import-manual-maintianers branch from 33bf373 to 4e22c9e Compare July 2, 2026 13:15
Copilot AI review requested due to automatic review settings July 2, 2026 13:50

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d264758. Configure here.

Comment thread services/libs/data-access-layer/src/osspckgs/maintainers.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

@ulemons
ulemons force-pushed the feat/import-manual-maintianers branch from d264758 to 5040801 Compare July 2, 2026 14:58
ulemons added 6 commits July 3, 2026 09:04
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Copilot AI review requested due to automatic review settings July 3, 2026 07:04
@ulemons
ulemons force-pushed the feat/import-manual-maintianers branch from 5040801 to f3852ca Compare July 3, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

@ulemons
ulemons merged commit 278e61b into main Jul 3, 2026
17 checks passed
@ulemons
ulemons deleted the feat/import-manual-maintianers branch July 3, 2026 07:14
skwowet pushed a commit that referenced this pull request Jul 3, 2026
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants